package deng.jboss.examples.webapplogging;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

public class HelloServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private static Logger logger = Logger.getLogger(HelloServlet.class);
	
	@Override
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {		log("GET requestURI: " + req.getRequestURI());
		//log("QueryString: " + req.getQueryString());
		logger.debug("RequestURL: " + req.getRequestURL());
		logger.debug("QueryString: " + req.getQueryString());
		
//		java.io.PrintWriter out = resp.getWriter();
//		out.println("Hello World.");
		
		req.getRequestDispatcher("/hello.jsp").forward(req, resp);
	}
	
}